#方式1
for n1 in range(0, 9):
    n1 += 1
    for n2 in range(0, 9):
        n2 += 1
        if n2 > n1:
            break
        c = n1 * n2
        print(n1, "x", n2, "=", c, end="  ")
    print()

#方式二
for n1 in range(1,10):
    for n2 in range(1, 10):
        if n2 <= n1:
            c = n1 * n2
            print(n1, "x", n2, "=", c, end="  ")
        else:
            break
    print()

def print99():
    b=""
    for n1 in range(1,10):
        for n2 in range(1,10):
            if n2>n1:
                break
            c=n1*n2
            b =b+ '{0}x{1}={2} '.format(n1,n2,c)
        b=b+"\n"
    return b
list99=print99()
print(list99)
